package com.alibaba.aliper.agent.sys;


public class CpuMonitor {
	public CpuMonitor() {
		this.endState = new CpuState();
		
	}
	private CpuState startState = null;
	private CpuState endState = null;
	private void monitor(){
		this.startState = this.endState;
		this.endState = new CpuState();
	}
	
	public CpuState getStartState() {
		return startState;
	}

	public CpuState getEndState() {
		return endState;
	}

	public CpuPercentage getCpuPercentage(){
		this.monitor();
		return this.endState.subtract(this.startState);
	}
}
